﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ActivitySystemDefaultPage.Master" AutoEventWireup="true" CodeBehind="UserList.aspx.cs" Inherits="ActivitySystem.Web.Admin.UserList" %>

<%@ Register Assembly="Sunyi.Project.WebPoint.WebControl" Namespace="Sunyi.Project.WebPoint.WebControl" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <style type="text/css">
        .div_search_result table
        {
            border: 1;
        }
        .div_content_searchbar input
        {
            width: 95px;
        }
        .div_content_searchbar span
        {
            margin: 2px;
        }
    </style>
    <asp:ScriptManager ID="scriptManager" runat="server" />
    <asp:UpdatePanel ID="updatePanel" runat="server">
        <ContentTemplate>
            <div id="div_content">
                <div id="div_content_searchbar">
                    <span>User Name:</span><asp:TextBox ID="tbxUserName" runat="server" />
                    <span>Role:</span><asp:DropDownList ID="ddlRole" runat="server" />
                    <span>Status:</span><asp:DropDownList ID="ddlStatus" runat="server">
                        <asp:ListItem Value="True">Enable</asp:ListItem>
                        <asp:ListItem Value="False">Disable</asp:ListItem>
                    </asp:DropDownList>
                    <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
                    <asp:Literal ID="litCreateNew" runat="server"><a href='UserEdit.aspx?Mode=Create' target="_blank">Add New</a></asp:Literal>
                </div>
                <div id="div_content_searchresult">
                    <cc1:PagingGridView ID="gvUsers" runat="server" AutoGenerateColumns="False" AllowPaging="True" OnPageIndexChanging="gvUser_PageIndexChanging" PageSize="20" Width="100%">
                        <Columns>
                            <asp:TemplateField HeaderText="User Name">
                                <ItemTemplate>
                                    <a href='UserEdit.aspx?UserId=<%# Eval("Id")%>&Mode=Read' target="_blank">
                                        <%# Eval("UserName")%></a>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Mail" HeaderText="Email" />
                            <asp:BoundField DataField="Department" HeaderText="Department" />
                            <asp:TemplateField HeaderText="Status">
                                <ItemTemplate>
                                    <%# Eval("IsActive").ToString() =="True" ? "Enable" : "Disable" %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Edit">
                                <ItemTemplate>
                                    <a href='UserEdit.aspx?UserId=<%# Eval("Id") %>&Mode=Update' target="_blank">Edit</a>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle BackColor="#546E96" ForeColor="#DFDFDF" />
                    </cc1:PagingGridView>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
